// src/api/server.js
import axios from "axios";

const instance = axios.create({
    baseURL: "/api",  // 保持你的配置
    timeout: 50000,
});

instance.interceptors.request.use(config => {
    const token = localStorage.getItem("token");
    if (token) {
        config.headers['token'] = token;
    }
    return config;
}, error => {
    return Promise.reject(error);
});

export default instance;
